The present invention relates to an image processing apparatus for processing an image input by error diffusion or the like.
In general, a text image processing apparatus capable of processing both bit information and image information simply binarizes, in accordance with a fixed threshold, contrast image information such as a character and line drawing on an original read by a reader unit such a scanner. This apparatus binarizes continuous tone image information such as a photograph by a pseudo-halftoning section according to dithering or the like, and outputs the binary information to, e.g., a binary printer having a small number of gray levels.
When read image information is simply binarized in accordance with a fixed threshold, the resolution of a character/line image region is preserved and the image quality does not suffer. However, the resolution of a photographic image region is not preserved, resulting in a low-quality image. When read image information is gradated by ordered dithering or the like, the resolution of a photographic image region is preserved and the image quality does not suffer. However, the resolution of a character/line image region decreases, resulting in a low-quality image. That is, only one binarization processing for read image information cannot simultaneously satisfy the image qualities of regions having different features.
As a binarization/multivalued scheme which satisfies the tone of a photographic image region and attains a higher resolution even for a character/line image region than ordered dithering, an xe2x80x9cerror diffusion methodxe2x80x9d is proposed. According to the xe2x80x9cerror diffusion methodxe2x80x9d (reference: An Adaptive Algorithm for Spatial Grayscale, by R. W. Floyd and L. Steinberg, Proceedings of the S.I.D. Vol. 17-2, pp. 75-77, Second Quarter 1976), a value obtained by multiplying a binarizing error of a binarized surrounding pixel by a given weighting coefficient is added to the density of a target pixel, and the target pixel is binarized in accordance with a fixed threshold.
FIG. 3 is a block diagram showing general binarization processing using the xe2x80x9cerror diffusion methodxe2x80x9d. In FIG. 3, an input image signal 2-1 is input to a section 2-2 for correcting an error from a preceding line (preceding line error) that corrects image information of a target pixel in accordance with a correction amount 2-17 diffused from the preceding line. An image signal 2-3 corrected in accordance with the preceding line error is input to a section 2-4 for correcting a pixel diffused from a preceding pixel. A corrected image signal 2-5 is input to a binarizing section (thresholding process) 2-6 for binarizing the corrected image information of the target pixel while comparing it with a threshold 2-7. A binarization image signal 2-8 is input to a binarizing error calculating section 2-9 for calculating a binarizing error of the target pixel on the basis of an output level 2-10 and the corrected image signal 2-5 depending on the binarization value. The binarizing error calculating section 2-9 outputs a binarizing error signal 2-11 to an error filtering section 2-12 for distributing the binarizing error calculated by the binarizing error calculating section 2-9 to surrounding pixels. The error filtering section 2-12 is made up of an error calculating section 2-13 for calculating an error to an adjacent pixel (adjacent pixel error), and error calculating section 2-14 for calculating an error to a next line (next line error).
An adjacent pixel error correction amount 2-15 is output to the section 2-4, and an error correction amount 2-16 to a next line is stored in an error buffer 2-18.
FIG. 4 is a circuit diagram showing an arrangement of a conventional binarizing circuit using the xe2x80x9cerror diffusion methodxe2x80x9d. The input image signal 2-1 read by an input device such as a scanner is corrected by the section 2-2 in accordance with an image correcting signal 2-17, and output as the error-corrected image signal 2-3. The error-corrected image signal 2-3 corrected in accordance with the preceding line error correction amount is corrected by the section 2-4 in accordance with the preceding pixel error correcting signal 2-15, and is output as the corrected image signal 2-5.
Upon receiving the corrected image signal 2-5, the binarizing section (comparator) 2-6 uses the corrected image signal 2-5 and a binarizing threshold Th (for example, xe2x80x9c80hxe2x80x9d; the suffix xe2x80x9chxe2x80x9d means xe2x80x9chexxe2x80x9d representing hexadecimal). The binarizing section 2-6 outputs xe2x80x9c1xe2x80x9d (black pixel) as the binarization image signal 2-8 if the corrected image signal 2-5 is larger than the binarizing threshold Th; otherwise it outputs xe2x80x9c0xe2x80x9d (white pixel).
The binarizing error calculating section 2-9 selects one output level 2-10 based on the binarization image signal 2-8 (i.e., selects an output level for 0 when the binarization image signal is xe2x80x9c0xe2x80x9d, and an output level for 1 when the signal is xe2x80x9c1xe2x80x9d). The binarizing error calculating section 2-9 calculates the difference between this output level and the corrected image signal 2-5, and outputs the difference as the binarizing error signal 2-11.
The error filtering section 2-12 has an error filter arrangement shown in FIG. 5. In FIG. 5, xe2x80x9cxe2x97xafxe2x80x9d indicates a target pixel position. The error filtering section 2-12 calculates weighting errors obtained by multiplying the binarizing error signal 2-11 by weighting coefficients kA, kB, kC, and kD (where kA={fraction (7/16)}, kB={fraction (1/16)}, kC={fraction (5/16)}, and kD={fraction (3/16)}). In other words, the error filtering section 2-12 multiplies the binarizing error of the target pixel by the weighting coefficients kA, kB, kC, and kD to calculate weighting errors to four pixels (pixels corresponding to the positions of the weighting coefficients kA, kB, kC, and kD) surrounding the target pixel.
The error correction amount 2-15 to the adjacent pixel in the main scanning direction is calculated by the error calculating section 2-13 in accordance with the coefficient kA and binarizing error signal 2-11. The error correction amount 2-15 is supplied from a delay element 2-19 to the correcting section 2-4 in response to a next processing clock. Similarly, the next line error correction amount 2-16 is calculated by the error calculating sections 2-14, and delay elements 2-20, 2-21, and 2-22 in accordance with the binarizing error signal 2-11 and filter coefficients kB, kC, and kD. The error buffer 2-18 temporarily stores the error correction amount 2-16 in addition to the sum of weighting errors eB, eC, and eD for three pixels from the preceding line. In this scheme, the following condition must be satisfied to diffuse all errors:
kA+kB+kC+kD=1
Recently even in error diffusion processing for an output device having a large number of gray levels (level number), the above-described binarizing section is replaced with a multivalued section using a number of thresholds corresponding to the number of gray levels.
According to the xe2x80x9cerror diffusion processingxe2x80x9d, an error generated by binarization/multivalued processing for a target pixel is diffused to surrounding pixels to correct the error, thereby minimizing the binarizing/multivalued error. One problem of this method is that texture (regular pattern) appears on an output image (particularly upon binarization processing).
Another method using a mask and AND instead of coefficients is also proposed. This is a high-speed method of reducing texture by a synergistic effect with variation noise of a scanner.
FIG. 6 shows a bit mask error diffusion method in detail. The bit mask error diffusion arrangement is the same as the conventional error diffusion arrangement shown in FIG. 4 except for the error filtering scheme.
Masks mA, mB, mC, and mD shown in FIG. 7 replace the coefficients kA, kB, kC, and kD, and filtering using logic calculation of a mask and error replaces filtering using multiplication of a coefficient and error. According to the filtering scheme in FIG. 6, the AND of the absolute value of a binarizing error and the mask is calculated as an error to be distributed, and is assigned a binarizing error code.
In this scheme, assuming that the maximum error is 255, the following condition must be satisfied to diffuse all errors:
mA+mB+mC+mD=255
Further, the following scheme is proposed. To increase the multivalued error diffusion speed, an error of a preceding line is corrected in advance, and then threshold processing is performed. Threshold errors are added, and the sum is added to an error from a preceding pixel (preceding pixel error). The sum range is calculated, and an output and error are corrected based on this range, thereby increasing the diffusion speed.
In this scheme, calculation of the error range and error correction must be completed within one pixel clock. Therefore, this scheme is effective to a certain degree for a multivalued error having a small number of bits. However, calculation of the range and error correction take a long time for a binarizing error.
The above-described methods are also variously devised in terms of tone reproduction. In any method, however, the processing speed is limited by a feedback type algorithm arrangement.
As described above, calculation of the error range and correction must be completed within one pixel clock. The scheme is effective to a certain degree for a multivalued error having a small number of bits. However, calculation of the range and error correction take a long time for a binarizing error. The processing speed is limited by a feedback type algorithm arrangement, failing to achieve high-speed processing.
It is an object of the present invention to provide an image processing apparatus capable of performing error diffusion processing for an input image at a high speed.
To achieve the above objects, according to the present invention, there is provided an image processing apparatus comprising: error correcting means for correcting an input image on the basis of a supplied error correction amount and outputting a corrected image; threshold processing means for processing the corrected image output from the error correcting means on the basis of a predetermined threshold, further processing the corrected image on the basis of the error correction amount, and outputting an output signal; correction amount calculating means for calculating in advance a plurality of correction amounts corresponding to possible values of the output signal in parallel with processing of the threshold processing means on the basis of the corrected image output from the error correcting means, and selecting one of the plurality of error correction amounts as the error correction amount in accordance with a value of the output signal actually output from the threshold processing means; and error correction amount supplying means for supplying the error correction amount calculated and selected by the correction amount calculating means to the error correcting means and the threshold processing means, and diffusing an error of the image to surrounding pixels.
As described above, the present invention does not wait for the result of the threshold processing section so as to calculate the error amount using the result, unlike the conventional error diffusion apparatus. The present invention performs error calculation processing for output values xe2x80x9c0xe2x80x9d and xe2x80x9c1xe2x80x9d (binary signal) in parallel with processing of the threshold processing section, and obtains calculation results for the two output values. The present invention selects one of the two calculation results in accordance with an output value from the threshold processing section.
Since the apparatus of the present invention executes the two processes in parallel, a time (t1+t2) spent for threshold processing (t1) and calculation processing (t2) in the conventional apparatus can be shortened to |t1+t2|. As a result, higher-speed error diffusion processing can be realized.
Additional objects and advantages of the invention will be set forth in the description which follows, and in part will be obvious from the description, or may be learned by practice of the invention. The objects and advantages of the invention may be realized and obtained by means of the instrumentalities and combinations particularly pointed out hereinafter.